// class Box4 {
//   content: string = ''

//   set(value: string) {
//     this.content = value
//     return this
//   }
// }

// class ClearableXox extends Box4 {
//   clear() {
//     this.content = ''
//   }
// }

// const a4 = new ClearableXox()
// const b4 = a4.set('hello')
// console.log(b4);

class Box4 {
  content: string = ''

  sameAs(other: this) {
    return other.content === this.content
  }
}

class DerivedBox4 extends Box4 {
  otherContent: string = '?'
}

const base4 = new Box4()
const derived4 = new DerivedBox4()
derived4.sameAs(base4)